<!-- 预览 -->
<template>
  <div class='company_proview'>
    <dt-modal-info ref='info' title='名片预览' :width='600'>
      <div class="proview_title">请使用微信扫码，预览名片完整效果</div>
      <div class="proview_img" >
        <img :src="proviewUrl" />
      </div>
  </dt-modal-info>
  <dt-loading :loading="loading" />
  </div>
</template>

<script>
  import companyApi from '@/biz/backStage/companyCard'
  export default {
    data() {
      return {
        proviewUrl:'',
        loading:false
      };
    },
    methods: {
      init(){
        this.loading = true
        this.$refs.info.show()
        let params={
          jumpUrl:'pages_card/detail',
          cid: this.$route.query.companyId,
          env_version: this.$dt.env.env == 'prod' ? 'release' : 'trial'
        }
        companyApi.getwxCodeUserCard(params).then(res => {
          if (res) {
            this.proviewUrl = res
            this.loading = false
          } 
        }).catch(err=>{
          this.loading = false
        })
      },
      
    },
    mounted() {},
  }
</script>
<style lang='scss' scoped>
  .company_proview {
    padding: 15px;
  }
  .proview_title{
    text-align: center;
    margin: 10px 0;
    font-size: 18px;

  }
  .proview_img{
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    img{
      height: 100%;
    }
  }
</style>